# 查找 im-admin.jar 对应的进程 ID
im_admin_pid=$(ps -ef | grep im-admin.jar | grep -v grep | awk '{print $2}')
if [ -n "$im_admin_pid" ]; then
    echo "正在停止 im-admin.jar 进程，PID: $im_admin_pid"
    kill $im_admin_pid
    sleep 5
    remaining_pid=$(ps -ef | grep im-admin.jar | grep -v grep | awk '{print $2}')
    if [ -n "$remaining_pid" ]; then
        echo "im-admin.jar 进程未能正常停止，强制终止，PID: $remaining_pid"
        kill -9 $remaining_pid
    else
        echo "im-admin.jar 进程已成功停止"
    fi
else
    echo "未找到正在运行的 im-admin.jar 进程"
fi